package TUILayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ControlLayer.*;
import ModelLayer.*;

public class AddressBookTest
{
    private AddressCtr addressCtr;
    Person person;
    public AddressBookTest()
    {
    }

    @Before
    public void setUp()
    {
    }

    @After
    public void tearDown()
    {
    }

    @Test
    public void addPersonTest()
    {
        TUILayer.AddressBookUI addressB2 = new TUILayer.AddressBookUI();
        String persont = "Test person";
        addressB2.addPerson(42, persont, "Test address", "9000", "Aalborg", "50101337");
    }

    @Test
    public void deletePersonTest()
    {
        TUILayer.AddressBookUI addressB1 = new TUILayer.AddressBookUI();
        addressB1.addPerson(42, "Test person", "Test address", "9000", "Aalborg", "50101337");
        addressB1.deletePerson(42);
    }

    @Test
    public void findPersonTest()
    {
        TUILayer.AddressBookUI addressB1 = new TUILayer.AddressBookUI();
        addressB1.addPerson(42, "Test person", "Test address", "9000", "Aalborg", "50101337");
        addressB1.findPerson(42);
    }

    @Test
    public void updatePersonTest()
    {
        TUILayer.AddressBookUI addressB2 = new TUILayer.AddressBookUI();
        addressB2.addPerson(42, "Test name", "Test address", "9000", "Aalborg", "50101337");
        addressB2.updatePerson(42, "Updated name", "Updated address");
    }

    @Test
    public void listPersonsTest()
    {
        TUILayer.AddressBookUI addressB1 = new TUILayer.AddressBookUI();
        addressB1.addPerson(1, "Person 1", "", "", "", "");
        addressB1.addPerson(2, "Person 2", "", "", "", "");
        addressB1.listAllPersons();
    }
}






